package com.example.demo;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
/** @author haijianxia pure_xhj@163.com @Date 2021-11-08 @Time 18:52 */
public class JsonReplaceDemo {
  public static void main(String[] args) {
    String json =
        "{\"birthday\":\"1995-12-1\",\"issued_by\":\"\",\"side\":\"front\",\"valid_date\":\"\",\"address\":\"河南省商水县胡吉镇闫庄村一组\",\"gender\":\"\",\"race\":\"汉\",\"name\":\"夏海建\",\"id_card_number\":\"\",\"type\":1}";
    JSONObject jsonObject = JSON.parseObject(json);

    String str = "asdf_asdf";
    str.replaceAll("asdf_asdf", "qwer");
    str = str.replaceAll("asdf_asdf", "qwer");
    System.out.println(str);

    json.replaceAll("issued_by","issuedBy");
    json=json.replaceAll("issued_by","issuedBy");
    json=json.replaceAll("id_card_number","idCardNumber");

    String str2="\"asdf_asdf\"";
    str2.replaceAll("asdf_asdf", "qwer");
    str2=str2.replaceAll("asdf_asdf", "qwer");
    System.out.println("str2 = " + str2);

  }
}
